package com.sinux.mms.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

/**会员
 * @author WangGan
 * @version 2017年6月10日 下午11:54:31 
 * 
 */
@Entity
@Table(name = "member")
@SuppressWarnings("all")
public class Member {
	/**会员id*/
	private String id;
	/**会员姓名*/
	private String name;
	/**会员手机*/
	private String phone;
	/**会员状态*/
	private String state;
	/**备注*/
	private String remark;
	/**日期*/
	private String cdate;
	/**消费记录*/
	private List<Record> listRecord=new ArrayList<Record>();
	
	private String temp1;
	private String temp2;
	private String temp3;
	private String temp4;
	
	@Id
	@GenericGenerator(name = "system-uuid", strategy = "uuid.hex")
	@GeneratedValue(generator = "system-uuid")
	@Column(name = "id", unique = true, nullable = false, length = 64)
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	
	@Column(name = "name", nullable = false, length = 64)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	@Column(name = "phone", nullable = false, length = 64)
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	@Column(name = "state", nullable = false, length = 64)
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	
	@Column(name = "remark", nullable = true, length = 128)
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	@Column(name = "cdate", nullable = true, length = 64)
	public String getCdate() {
		return cdate;
	}
	public void setCdate(String cdate) {
		this.cdate = cdate;
	}
	//FetchType.LAZY
	@OneToMany(mappedBy="member",fetch = FetchType.EAGER,orphanRemoval = true)
	public List<Record> getListRecord() {
		return listRecord;
	}
	public void setListRecord(List<Record> listRecord) {
		this.listRecord = listRecord;
	}
	
	public String getTemp1() {
		return temp1;
	}
	public void setTemp1(String temp1) {
		this.temp1 = temp1;
	}
	public String getTemp2() {
		return temp2;
	}
	public void setTemp2(String temp2) {
		this.temp2 = temp2;
	}
	public String getTemp3() {
		return temp3;
	}
	public void setTemp3(String temp3) {
		this.temp3 = temp3;
	}
	public String getTemp4() {
		return temp4;
	}
	public void setTemp4(String temp4) {
		this.temp4 = temp4;
	}
	
	
	

}
